<!DOCTYPE html>
<meta charset="koi8-r">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
async_test(t => {
  var count = 0;
    window.addEventListener('message', t.step_func(e => {
      assert_equals(e.data.value, "ðÒÏ×ÅÒËÁ");
      count++;
      if (count == 3) {
        t.done();
      }
    }));
});
</script>
<iframe src="data:text/html,<meta charset='utf-8'><body><div>ðÒÏ×ÅÒËÁ</div><script>window.parent.postMessage({frame: 1, value: document.body.firstChild.innerHTML}, '*');</script></body>"></iframe>
<iframe src="data:text/html,<meta charset='utf-8'><body foo='%23'><div>ðÒÏ×ÅÒËÁ</div><script>window.parent.postMessage({frame: 2, value: document.body.firstChild.innerHTML}, '*');</script></body>"></iframe>
<iframe src="data:text/html,<meta charset='utf-8'><body><div>%D1%86%E2%95%9F%D1%86%E2%96%93%D1%86%E2%96%90%D1%86%E2%89%88%D1%86%E2%94%98%D1%86%E2%96%93%D1%86%E2%96%80%D1%86%E2%94%82</div><script>window.parent.postMessage({frame: 3, value: document.body.firstChild.innerHTML}, '*');</script></body>"></iframe>

</body>
